import Vue from 'vue'

import jsPlumb from 'jsplumb'
Vue.prototype.$jsPlumb = jsPlumb.jsPlumb

import Router from 'vue-router'
import main from '@/components/MainView'
import projectManagement from '@/components/project/project'
import plan from '@/components/plan/plan'
import meteorological from '@/components/plan/meteorological'
import dispatch from '@/components/dispatch/dispatch'
import load from '@/components/dispatch/load'
import equip from '@/components/dispatch/equip'
import param from '@/components/dispatch/param'
import beforeResult from '@/components/dispatch/beforeResult'
import afterResult from '@/components/dispatch/afterResult'
/* 方案规划 */
import planProgram from '@/components/planProgram/planProgram'
import load2 from '@/components/planProgram/load'
import plan2 from '@/components/planProgram/plan'
import resource from '@/components/planProgram/resource'
import solar from '@/components/planProgram/solar'
import wind from '@/components/planProgram/wind'
import fuelgas from '@/components/planProgram/fuelgas'
import electricity from '@/components/planProgram/electricity'
import geothermal from '@/components/planProgram/geothermal'
import steam from '@/components/planProgram/steam'
import hotWater from '@/components/planProgram/hotWater'
import smoke from '@/components/planProgram/smoke'
import water from '@/components/planProgram/water'
import paramSet from '@/components/planProgram/paramSet'
import planResult from '@/components/planProgram/planResult'

/*登录页面*/
import login from '@/components/login/login'

import econmicProjectMaintenance from '@/components/economicAnalysis/econmicProjectMaintenance'

import designProjectMaintenance from '@/components/economicAnalysis/designProjectMaintenance'



/*经济性分析*/
import economicAnalysisMain from '@/components/economicAnalysis/economicAnalysisMain'
import economicAnalysis from '@/components/economicAnalysis/economicAnalysis'
import htEconomicAnalysis from '@/components/economicAnalysis/htEconomicAnalysis'
import hpEconomicAnalysis from '@/components/economicAnalysis/hpEconomicAnalysis'
import huEconomicAnalysis from '@/components/economicAnalysis/huEconomicAnalysis'
// ------------------
//制(储)路径
import hydrogenProductionPathway from '@/components/economicAnalysis/hydrogenProductionPathway'
//电力来源
import powerSource from '@/components/economicAnalysis/powerSource'
//氢⽓负荷
import hydrogenGasLoad from '@/components/economicAnalysis/hydrogenGasLoad'
//资源参数
import resourceParameters from '@/components/economicAnalysis/resourceParameters'
//模拟计算
import hpAnalogComputation from '@/components/economicAnalysis/hpAnalogComputation'
//成本明细
import costBreakdown from '@/components/economicAnalysis/costBreakdown'
//经济性分析
import economicAnalysisHP from '@/components/economicAnalysis/economicAnalysisHP'
//模型误差
import hpErrorModel from '@/components/economicAnalysis/hpErrorModel'


// ----------------

// 输氢------------------


import trailerHydrogenTransport from '@/components/economicAnalysis/trailerHydrogenTransport'
import pipelineHydrogenTransport from '@/components/economicAnalysis/pipelineHydrogenTransport'

//输氢方案
import hydrogenTransPlan from '@/components/economicAnalysis/hydrogenTransPlan'
//运输路径
import transportationRoute from '@/components/economicAnalysis/transportationRoute'
//模拟计算
import htAnalogComputation from '@/components/economicAnalysis/htAnalogComputation'

import htErrorModel from '@/components/economicAnalysis//htErrorModel'
import phtErrorModel from '@/components/economicAnalysis//phtErrorModel'

import pemfcErrorModel from '@/components/economicAnalysis//pemfcErrorModel'
import gmwhErrorModel from '@/components/economicAnalysis//gmwhErrorModel'


//氢⽓负荷
import hydrogenGasLoadPht from '@/components/economicAnalysis/hydrogenGasLoadPht'
//参数设置
import parameterSettings from '@/components/economicAnalysis/parameterSettings'
import parameterSettingsPht from '@/components/economicAnalysis/parameterSettingsPht'
import phtAnalogComputation from '@/components/economicAnalysis/phtAnalogComputation'

//成本明细
import costBreakdownHT from '@/components/economicAnalysis/costBreakdownHT'
import costBreakdownPht from '@/components/economicAnalysis/costBreakdownPht'


//经济性分析
import economicAnalysisHT from '@/components/economicAnalysis/economicAnalysisHT'
import economicAnalysisPht from '@/components/economicAnalysis/economicAnalysisPht'


// ----------------

// ------------------
import pemfcEconomicAnalysis from '@/components/economicAnalysis/pemfcEconomicAnalysis'
import gmwhEconomicAnalysis from '@/components/economicAnalysis/gmwhEconomicAnalysis'
// ------------------



//规划设计
/*规划设计*/
import planAndDesignMain from '@/components/planAndDesign/planAndDesignMain'
import planAndDesign from '@/components/planAndDesign/planAndDesign'
//制(储)氢系统规划设计
import elecWaterPlanDesign from '@/components/planAndDesign/elecWaterPlanDesign'

import hydrogenTransmissionPlanDesign from '@/components/planAndDesign/hydrogenTransmissionPlanDesign'
import htSchemeSelection from '@/components/planAndDesign/htSchemeSelection'
import supplyDemandInfo from '@/components/planAndDesign/supplyDemandInfo'
import htpdAnalogComputation from '@/components/planAndDesign/htpdAnalogComputation'
import planningResults from '@/components/planAndDesign/planningResults'
import htpdCostBreakdown from '@/components/planAndDesign/htpdCostBreakdown'

//氢能综合供能场景规划设计
import hydrogenEnergyPlanDesign from '@/components/planAndDesign/hydrogenEnergyPlanDesign'
//综合能源系统规划设计
import integratedEnergyPlanDesign from '@/components/planAndDesign/integratedEnergyPlanDesign'
//制(储)路径
import ewHydrogenProductionPathway from '@/components/planAndDesign/ewHydrogenProductionPathway'
//氢气负荷
import ewHydrogenGasLoad from '@/components/planAndDesign/ewHydrogenGasLoad'
//资源参数
import ewResourceParameters from '@/components/planAndDesign/ewResourceParameters'
import ewAnalogComputation from '@/components/planAndDesign/ewAnalogComputation'

//配置方案
import configurationPlan from '@/components/planAndDesign/configurationPlan'
//成本明细 
import ewCostBreakdown from '@/components/planAndDesign/ewCostBreakdown'
//经济性分析
import ewEeconomicAnalysis from '@/components/planAndDesign/ewEeconomicAnalysis'

//负荷
import heLoadPage from '@/components/planAndDesign/heLoadPage'
//方案选型
import schemeSelection from '@/components/planAndDesign/schemeSelection'
//资源参数 
import heResourceParameters from '@/components/planAndDesign/heResourceParameters'
import heAnalogComputation from '@/components/planAndDesign/heAnalogComputation'

//配置方案
import heConfigurationPlan from '@/components/planAndDesign/heConfigurationPlan'

//成本明细 
import heCostBreakdown from '@/components/planAndDesign/heCostBreakdown'
//运行特性
import operationCharacteristics from '@/components/planAndDesign/operationCharacteristics'





/*负荷仿真页面*/
import loadSimulation from '@/components/loadSimulation/loadSimulation'
/*场景设置*/
import sceneSettings from '@/components/loadSimulation/sceneSettings'
/*仿真结果*/
import simulationResult from '@/components/loadSimulation/simulationResult'
/*玻璃温室场景设置*/
import glassGreenhouseSettings from '@/components/loadSimulation/glassGreenhouseSettings'
/*楼宇场景设置*/
import buildingSettings from '@/components/loadSimulation/buildingSettings'
import pageOne from '@/components/loadSimulation/pageOne'
import pageTwo from '@/components/planProgram/pageTwo'  
import pageThree from '@/components/loadSimulation/pageThree'
import pageFour from '@/components/loadSimulation/pageFour'

/*基础数据库*/
import basicDatabase from '@/components/basicDatabase/basicDatabase'

/*资源库*/
import resourceBase from '@/components/resourceBase/resourceBase'
/* 风机资源维护 */
import fanResource from '@/components/resourceBase/fanResource'

import deviceLibrary from '@/components/resourceBase/deviceLibrary'


/* 光伏资源维护 */
import gfResource from '@/components/resourceBase/gfResource'
/* 燃气轮机资源维护 */
import rqljResource from '@/components/resourceBase/rqljResource'
/* 燃气锅炉资源维护 */
import rqglResource from '@/components/resourceBase/rqglResource'
/* 溴冷机资源维护 */
import xljResource from '@/components/resourceBase/xljResource'
/* 电锅炉资源维护 */
import dglResource from '@/components/resourceBase/dglResource'
/* 冷水机组资源维护 */
import lsjzResource from '@/components/resourceBase/lsjzResource'
/* 空气热源泵资源维护 */
import kqyrbResource from '@/components/resourceBase/kqyrbResource'
/* 水源热泵资源维护 */
import syrbResource from '@/components/resourceBase/syrbResource'
/* 地源热泵资源维护 */
import dyrbResource from '@/components/resourceBase/dyrbResource'
/* 储能资源维护 */
import cnResource from '@/components/resourceBase/cnResource'
/* 蓄冷资源维护 */
import xlResource from '@/components/resourceBase/xlResource'
/* 蓄热资源维护 */
import xrResource from '@/components/resourceBase/xrResource'
/* 材料资源维护 */
import clResource from '@/components/resourceBase/clResource'
/* 结构资源维护 */
import jgResource from '@/components/resourceBase/jgResource'

import mainPage from '@/components/mainPage/mainPage'


Vue.use(Router)
const router = new Router({
  mode: "history",
  routes: [{
    path: '/ieps',
    name: 'index',
    component: main,
    children: [{
      path: "/",
      component: mainPage,
      meta: {
        title: '首页',
        requireAuth: true
      },
      title: "首页"
    },{
      path: "/projectManagement",
      component: projectManagement,
      meta: {
        title: '项目管理',
        requireAuth: true
      },
      title: "项目管理"
    },
    {
      path: '/econmicProjectMaintenance',
      name: 'econmicProjectMaintenance',
      component: econmicProjectMaintenance,
      meta: {
        title: '经济性分析',
        requireAuth: true
      },
      children: [
        
      ]
    },
    {
      path: '/economicAnalysis',
      name: 'economicAnalysis',
      component: economicAnalysis,
      meta: {
        title: '经济性分析',
        requireAuth: true
      },
      children: [
        {
          path: '/hpEconomicAnalysis',
          name: 'hpEconomicAnalysis',
          component: hpEconomicAnalysis,
          meta: {
            title: '制(储)氢经济性分析',
            requireAuth: true
          },
          children: [
            {
              path: '/hydrogenProductionPathway',
              name: 'hydrogenProductionPathway',
              component: hydrogenProductionPathway,
              meta: {
                title: '制(储)路径',
                requireAuth: true
              }
            },{
              path: '/powerSource',
              name: 'powerSource',
              component: powerSource,
              meta: {
                title: '电力来源',
                requireAuth: true
              }
            },{
              path: '/hydrogenGasLoad',
              name: 'hydrogenGasLoad',
              component: hydrogenGasLoad,
              meta: {
                title: '氢⽓负荷',
                requireAuth: true
              }
            },{
              path: '/resourceParameters',
              name: 'resourceParameters',
              component: resourceParameters,
              meta: {
                title: '资源参数',
                requireAuth: true
              }
            },{
              path: '/hpAnalogComputation',
              name: 'hpAnalogComputation',
              component: hpAnalogComputation,
              meta: {
                title: '模拟计算',
                requireAuth: true
              }
            },{
              path: '/costBreakdown',
              name: 'costBreakdown',
              component: costBreakdown,
              meta: {
                title: '成本明细',
                requireAuth: true
              }
            },{
              path: '/economicAnalysisHP',
              name: 'economicAnalysisHP',
              component: economicAnalysisHP,
              meta: {
                title: '成本明细',
                requireAuth: true
              }
            },{
              path: '/hpErrorModel',
              name: 'hpErrorModel',
              component: hpErrorModel,
              meta: {
                title: '模型误差',
                requireAuth: true
              }
            },
          ]
        },
        {
          path: '/htEconomicAnalysis',
          name: 'htEconomicAnalysis',
          component: htEconomicAnalysis,
          meta: {
            title: '输氢经济性分析',
            requireAuth: true
          },

          children: [
            
          ]

        },
        {
          path: '/trailerHydrogenTransport',
          name: 'trailerHydrogenTransport',
          component: trailerHydrogenTransport,
          meta: {
            title: '长管拖车输氢',
            requireAuth: true
          },
          children: [
            {
              path: '/transportationRoute',
              name: 'transportationRoute',
              component: transportationRoute,
              meta: {
                title: '运输路径',
                requireAuth: true
              }
            },{
              path: '/parameterSettings',
              name: 'parameterSettings',
              component: parameterSettings,
              meta: {
                title: '参数设置',
                requireAuth: true
              }
            },{
              path: '/htAnalogComputation',
              name: 'htAnalogComputation',
              component: htAnalogComputation,
              meta: {
                title: '模拟计算',
                requireAuth: true
              }
            },{
              path: '/costBreakdownHT',
              name: 'costBreakdownHT',
              component: costBreakdownHT,
              meta: {
                title: '成本明细',
                requireAuth: true
              }
            },{
              path: '/economicAnalysisHT',
              name: 'economicAnalysisHT',
              component: economicAnalysisHT,
              meta: {
                title: '经济性分析',
                requireAuth: true
              }
            },{
              path: '/htErrorModel',
              name: 'htErrorModel',
              component: htErrorModel,
              meta: {
                title: '模型误差',
                requireAuth: true
              }
            },
          ]
        },{
          path: '/pipelineHydrogenTransport',
          name: 'pipelineHydrogenTransport',
          component: pipelineHydrogenTransport,
          meta: {
            title: '纯氢管道输氢',
            requireAuth: true
          },
          children: [
            {
              path: '/hydrogenGasLoadPht',
              name: 'hydrogenGasLoadPht',
              component: hydrogenGasLoadPht,
              meta: {
                title: '氢⽓负荷',
                requireAuth: true
              }
            },{
              path: '/parameterSettingsPht',
              name: 'parameterSettingsPht',
              component: parameterSettingsPht,
              meta: {
                title: '参数设置',
                requireAuth: true
              }
            },{
              path: '/phtAnalogComputation',
              name: 'phtAnalogComputation',
              component: phtAnalogComputation,
              meta: {
                title: '模拟计算',
                requireAuth: true
              }
            },{
              path: '/costBreakdownPht',
              name: 'costBreakdownPht',
              component: costBreakdownPht,
              meta: {
                title: '成本明细',
                requireAuth: true
              }
            },{
              path: '/economicAnalysisPht',
              name: 'economicAnalysisPht',
              component: economicAnalysisPht,
              meta: {
                title: '经济性分析',
                requireAuth: true
              }
            },{
              path: '/phtErrorModel',
              name: 'phtErrorModel',
              component: phtErrorModel,
              meta: {
                title: '模型误差',
                requireAuth: true
              }
            },
          ]
        },
        {
          path: '/huEconomicAnalysis',
          name: 'huEconomicAnalysis',
          component: huEconomicAnalysis,
          meta: {
            title: '用氢经济性分析',
            requireAuth: true
          },
          
          children: [
            {
              path: '/pemfcEconomicAnalysis',
              name: 'pemfcEconomicAnalysis',
              component: pemfcEconomicAnalysis,
              meta: {
                title: 'PEMFC热电联供经济性分析',
                requireAuth: true
              }
            },{
              path: '/gmwhEconomicAnalysis',
              name: 'gmwhEconomicAnalysis',
              component: gmwhEconomicAnalysis,
              meta: {
                title: '燃⽓掺氢经济性分析',
                requireAuth: true
              }
            },{
              path: '/pemfcErrorModel',
              name: 'pemfcErrorModel',
              component: pemfcErrorModel,
              meta: {
                title: '模型误差',
                requireAuth: true
              }
            },
          ]
        }
      ]
    },
    {
      path: '/designProjectMaintenance',
      name: 'designProjectMaintenance',
      component: designProjectMaintenance,
      meta: {
        title: '规划设计',
        requireAuth: true
      },
      children: [
        
      ]
    },
    
    {
      path: '/planAndDesign',
      name: 'planAndDesign',
      component: planAndDesign,
      meta: {
        title: '规划设计',
        requireAuth: true
      },
      children: [
        {
          path: '/elecWaterPlanDesign',
          name: 'elecWaterPlanDesign',
          component: elecWaterPlanDesign,
          meta: {
            title: '制(储)氢系统规划设计',
            requireAuth: true
          },
          children: [
            {
              path: '/ewHydrogenProductionPathway',
              name: 'ewHydrogenProductionPathway',
              component: ewHydrogenProductionPathway,
              meta: {
                title: '制(储)路径',
                requireAuth: true
              }
            },{
              path: '/ewHydrogenGasLoad',
              name: 'ewHydrogenGasLoad',
              component: ewHydrogenGasLoad,
              meta: {
                title: '氢气负荷',
                requireAuth: true
              }
            },{
              path: '/ewResourceParameters',
              name: 'ewResourceParameters',
              component: ewResourceParameters,
              meta: {
                title: '资源参数',
                requireAuth: true
              }
            },{
              path: '/ewAnalogComputation',
              name: 'ewAnalogComputation',
              component: ewAnalogComputation,
              meta: {
                title: '模拟计算',
                requireAuth: true
              }
            },{
              path: '/configurationPlan',
              name: 'configurationPlan',
              component: configurationPlan,
              meta: {
                title: '配置方案',
                requireAuth: true
              }
            },{
              path: '/ewCostBreakdown',
              name: 'ewCostBreakdown',
              component: ewCostBreakdown,
              meta: {
                title: '成本明细',
                requireAuth: true
              }
            },{
              path: '/ewEeconomicAnalysis',
              name: 'ewEeconomicAnalysis',
              component: ewEeconomicAnalysis,
              meta: {
                title: '经济性分析',
                requireAuth: true
              }
            },
          ]
        },
        {
          path: '/hydrogenTransmissionPlanDesign',
          name: 'hydrogenTransmissionPlanDesign',
          component: hydrogenTransmissionPlanDesign,
          meta: {
            title: '输氢系统规划设计',
            requireAuth: true
          },
          children: [
            {
              path: '/htSchemeSelection',
              name: 'htSchemeSelection',
              component: htSchemeSelection,
              meta: {
                title: '方案选型',
                requireAuth: true
              }
            },
            {
              path: '/supplyDemandInfo',
              name: 'supplyDemandInfo',
              component: supplyDemandInfo,
              meta: {
                title: '供需信息',
                requireAuth: true
              }
            },
            {
              path: '/htpdAnalogComputation',
              name: 'htpdAnalogComputation',
              component: htpdAnalogComputation,
              meta: {
                title: '模拟计算',
                requireAuth: true
              }
            },
            {
              path: '/planningResults',
              name: 'planningResults',
              component: planningResults,
              meta: {
                title: '规划结果',
                requireAuth: true
              }
            },
            {
              path: '/htpdCostBreakdown',
              name: 'htpdCostBreakdown',
              component: htpdCostBreakdown,
              meta: {
                title: '成本明细',
                requireAuth: true
              }
            },
          ]
        },
        {
          path: '/hydrogenEnergyPlanDesign',
          name: 'hydrogenEnergyPlanDesign',
          component: hydrogenEnergyPlanDesign,
          meta: {
            title: '氢能综合供能场景规划设计',
            requireAuth: true
          },
          children: [ 
            {
              path: '/heLoadPage',
              name: 'heLoadPage',
              component: heLoadPage,
              meta: {
                title: '负荷',
                requireAuth: true
              }
            },{
              path: '/schemeSelection',
              name: 'schemeSelection',
              component: schemeSelection,
              meta: {
                title: '方案选型',
                requireAuth: true
              }
            },{
              path: '/heResourceParameters',
              name: 'heResourceParameters',
              component: heResourceParameters,
              meta: {
                title: '资源参数',
                requireAuth: true
              }
            },{
              path: '/heAnalogComputation',
              name: 'heAnalogComputation',
              component: heAnalogComputation,
              meta: {
                title: '模拟计算',
                requireAuth: true
              }
            },{
              path: '/heConfigurationPlan',
              name: 'heConfigurationPlan',
              component: heConfigurationPlan,
              meta: {
                title: '配置方案',
                requireAuth: true
              }
            },{
              path: '/heCostBreakdown',
              name: 'heCostBreakdown',
              component: heCostBreakdown,
              meta: {
                title: '成本明细',
                requireAuth: true
              }
            },{
              path: '/operationCharacteristics',
              name: 'operationCharacteristics',
              component: operationCharacteristics,
              meta: {
                title: '运行特性',
                requireAuth: true
              }
            },
          ]
        },
        {
          path: '/integratedEnergyPlanDesign',
          name: 'integratedEnergyPlanDesign',
          component: integratedEnergyPlanDesign,
          meta: {
            title: '综合能源系统规划设计',
            requireAuth: true
          },
          
          children: [ 
            {
              path: '/loadSimulation',
              name: 'loadSimulation',
              component: loadSimulation,
              meta: {
                title: '负荷仿真',
                requireAuth: true
              },
              children: [{
                path: '/sceneSettings',
                name: 'sceneSettings',
                component: sceneSettings,
                meta: {
                  title: '场景设置',
                  requireAuth: true
                },
                children: [{
                  path: '/glassGreenhouseSettings',
                  name: 'glassGreenhouseSettings',
                  component: glassGreenhouseSettings,
                  meta: {
                    title: '玻璃温室场景设置',
                    requireAuth: true
                  }
                }, {
                  path: '/buildingSettings',
                  name: 'buildingSettings',
                  component: buildingSettings,
                  meta: {
                    title: '楼宇场景设置',
                    requireAuth: true
                  }
                }]
              }, {
                path: '/simulationResult',
                name: 'simulationResult',
                component: simulationResult,
                meta: {
                  title: '仿真结果',
                  requireAuth: true
                }
              }, {
                path: '/pageOne',
                name: 'pageOne',
                component: pageOne,
                meta: {
                  title: 'pageOne',
                  requireAuth: true
                }
              }]
            },
            {
              path: "/planProgram",
              name: "planProgram",
              component: planProgram,
              title: "方案规划",
              meta: {
                title: '方案规划',
                requireAuth: false
              },
              children: [{
                path: "/",
                component: meteorological,
                title: "气象",
                meta: {
                  requireAuth: true
                }
              }, {
                path: "/load2",
                component: load2,
                title: "负荷",
                meta: {
                  requireAuth: true
                }
              }, {
                path: "/plan2",
                component: plan2,
                title: "方案选型",
                meta: {
                  requireAuth: true
                }
              }, {
                path: "/resource",
                component: resource,
                title: "资源",
                meta: {
                  requireAuth: true
                },
                children: [{
                  path: "/",
                  component: solar,
                  title: "太阳能",
                  meta: {
                    requireAuth: true
                  }
                }, {
                  path: "/wind",
                  component: wind,
                  title: "风能",
                  meta: {
                    requireAuth: true
                  }
                }, {
                  path: "/fuelgas",
                  component: fuelgas,
                  title: "燃气",
                  meta: {
                    requireAuth: true
                  }
                }, {
                  path: "/electricity",
                  component: electricity,
                  title: "电",
                  meta: {
                    requireAuth: true
                  }
                }, {
                  path: "/geothermal",
                  component: geothermal,
                  title: "地热",
                  meta: {
                    requireAuth: true
                  }
                }, {
                  path: "/steam",
                  component: steam,
                  title: "蒸汽",
                  meta: {
                    requireAuth: true
                  }
                }, {
                  path: "/hotWater",
                  component: hotWater,
                  title: "热水",
                  meta: {
                    requireAuth: true
                  }
                }, {
                  path: "/smoke",
                  component: smoke,
                  title: "烟气",
                  meta: {
                    requireAuth: true
                  }
                }, {
                  path: "/water",
                  component: water,
                  title: "水源",
                  meta: {
                    requireAuth: true
                  }
                }]
              }, {
                path: "/paramSet",
                component: paramSet,
                title: "参数设定",
                meta: {
                  requireAuth: true
                }
              }, {
                path: "/planResult",
                component: planResult,
                title: "规划结果",
                meta: {
                  requireAuth: true
                }
              },{
                path: '/pageTwo',
                name: 'pageTwo',
                component: pageTwo,
                meta: {
                  title: 'pageTwo',
                  requireAuth: true
                }
              }, ]
            }, {
              path: "/dispatch",
              name: "dispatch",
              component: dispatch,
              title: "调度优化",
              meta: {
                title: '调度优化',
                requireAuth: true
              },
              children: [{
                path: "/",
                component: load,
                meta: {
                  requireAuth: true
                },
                title: "负荷"
              }, {
                path: "/equip",
                component: equip,
                meta: {
                  requireAuth: true
                },
                title: "设备信息"
              }, {
                path: "/param",
                component: param,
                meta: {
                  requireAuth: true
                },
                title: "参数设定"
              }, {
                path: "/beforeResult",
                component: beforeResult,
                meta: {
                  requireAuth: true
                },
                title: "日前优化结果"
              }, {
                path: "/afterResult",
                component: afterResult,
                meta: {
                  requireAuth: true
                },
                title: "日中优化结果"
              },{
                path: '/pageThree',
                name: 'pageThree',
                component: pageThree,
                meta: {
                  title: 'pageThree',
                  requireAuth: true
                }
              },  {
                path: '/pageFour',
                name: 'pageFour',
                component: pageFour,
                meta: {
                  title: 'pageFour',
                  requireAuth: true
                }
              }]
            }
          ]
        }
      ]
    },
    
    {
      path: '/basicDatabase',
      name: 'basicDatabase',
      component: basicDatabase,
      title: '基础数据库',
      meta: {
        requireAuth: true
      }
    },

    {
        path: '/resourceBase',
        component: resourceBase,
        title: '设备库',
        meta: {
          requireAuth: true
        },
        children: [
          {
            path: '/deviceLibrary',
            component: deviceLibrary,
            meta: {
              requireAuth: true
            },
            title: '设备库2'
          },
          {
            path: '/fanResource',
            component: fanResource,
            meta: {
              requireAuth: true
            },
            title: '风机'
          },
          {
            path: '/gfResource',
            component: gfResource,
            meta: {
              requireAuth: true
            },
            title: '光伏'
          },
          {
            path: '/rqljResource',
            component: rqljResource,
            meta: {
              requireAuth: true
            },
            title: '燃气轮机'
          },
          {
            path: '/rqglResource',
            component: rqglResource,
            meta: {
              requireAuth: true
            },
            title: '燃气锅炉'
          },
          {
            path: '/xljResource',
            component: xljResource,
            meta: {
              title: '溴冷机',
              requireAuth: true
            }
          },
          {
            path: '/dglResource',
            component: dglResource,
            meta: {
              requireAuth: true
            },
            title: '电锅炉'
          },
          {
            path: '/lsjzResource',
            component: lsjzResource,
            meta: {
              requireAuth: true
            },
            title: '冷水机组'
          },
          {
            path: '/kqyrbResource',
            component: kqyrbResource,
            meta: {
              requireAuth: true
            },
            title: '空气热源泵'
          },
          {
            path: '/syrbResource',
            component: syrbResource,
            meta: {
              requireAuth: true
            },
            title: '水源热泵'
          },
          {
            path: '/dyrbResource',
            component: dyrbResource,
            meta: {
              requireAuth: true
            },
            title: '地源热泵'
          },
          {
            path: '/cnResource',
            component: cnResource,
            meta: {
              requireAuth: true
            },
            title: '储能'
          },
          {
            path: '/xlResource',
            component: xlResource,
            meta: {
              requireAuth: true
            },
            title: '蓄冷'
          },
          {
            path: '/xrResource',
            component: xrResource,
            meta: {
              requireAuth: true
            },
            title: '蓄热'
          },
          {
            path: '/clResource',
            component: clResource,
            meta: {
              requireAuth: true
            },
            title: '材料'
          },
          {
            path: '/jgResource',
            component: jgResource,
            meta: {
              requireAuth: true
            },
            title: '结构'
          }
        ]
      }
    ]
  },{
    path: '/login',
    component: login,
    name: 'login',
    meta: {
      requireAuth: false
    }
  },
  ]
});

/**/
export default router
router.beforeEach((to, from, next) => {

  if (to.meta.requireAuth) { // 判断该路由是否需要登录权限
    if (sessionStorage.getItem("token") == 'true') { // 判断本地是否存在token
      next()
    } else {
      // 未登录,跳转到登陆页面
      next({
        path: '/login'
      })
    }
  } else {
    if(sessionStorage.getItem("token") == 'true'){
      next('/ieps');
    }else{
      next();
    }
  }
});
